This invention relates generally to decimal division, and more particularly, to the decimal division on two decimal operands in binary coded decimal (BCD) format.
In the past, a simple method for performing long division by a programmed computer subtracted a divisor from a dividend until the result of the subtraction operation was a negative value. The number of subtractions minus one yields the quotient. The remainder of the division was determined by adding the divisor to the negative result.
Alternatively, the divisor is repeatedly subtracted from a portion of the dividend comprising a like number of leading digits of the dividend. If the first subtraction is negative, the division is subtracted from a like number of leading dividend digits plus one. Otherwise, once the result of the subtraction is negative, no further subtractions are performed and the divisor is added to the negative result to attain the remainder. The number of subtractions minus one comprises a first digit of the quotient. The process is repeated with the divisor being subtracted from the remainder, and modified by appending additional digits from the original dividend to equal the number of divisor digits. The number of such subtractions minus one is appended as a next digit of the quotient. This improved method for determining the quotient of a division operation is still time consuming due to the large number of subtraction operations that must be performed when dividing a large dividend by a relatively small divisor.
Another method is referred to as a non-restoring division algorithm. The non-restoring division algorithm creates stored multiplies and performs repetitive subtraction to calculate a quotient. Generally, there are four parts to performing a non-restoring division algorithm: 1) quotient selection; 2) divisor multiple creation; 3) subtracting divisor multiples from the previous remainder to form the new remainder; and 4) quotient accumulation. For decimal division, the size of the quotient logic for a typical non-restoring division algorithm can get very large, and the logic may be too large to be implemented within performance and space requirements. It would be desirable to be able to perform non-restoring decimal division in a more efficient manner.